package com.xizi.java8_time;

import java.lang.reflect.Method;

/**
 * @author xizizzz
 * @description: TODO
 * @date 2021-7-16上午 11:35
 */
public class TestAnnotation {


    @MyAnnotation("Hello")
    @MyAnnotation("World")
    public void show(@MyAnnotation("abc") String str) {

    }

    public static void main(String[] args) throws Exception {
        Class<TestAnnotation> clazz = TestAnnotation.class;
        Method m1 = clazz.getMethod("show");
        MyAnnotation[] ma = m1.getAnnotationsByType(MyAnnotation.class);
        for (MyAnnotation myAnnotation : ma) {
            System.out.println(myAnnotation);
        }


    }
}
